Python Without Fear by Brian Overland

Python Without Fear by Brian Overland

Author:Brian Overland
Language: eng
Format: epub, azw3
Publisher: Pearson Education Limited (US titles)
Published: 2018-03-18T04:00:00+00:00


import os

Import the os module.

help(os)

From within the interactive environment, this prints a list of os functions and other features.

os.listdir()

List directory. Returns a list, each element of which is a string containing a file name.

os.chdir(string)

Change directory. The string can contain either a relative or a full path name.

os.getcwd()

Get Current Working Directory. Returns the full path name of the current directory, in a string.

The following figure illustrates the move from a directory to a subdirectory. The string “Python Txt” is a relative, not a full, path name; it does not begin with a slash (/).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.